package com.kevin.springcloud.ribbonconsumer.controller;

import com.kevin.springcloud.ribbonconsumer.RibbonService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Ribbon")
public class HelloRibbonController {
    @Autowired
    private RibbonService ribbonService;


    @GetMapping("sayHello")
    public String sayHello(){
        return ribbonService.sayHello();
    }

    @GetMapping("saySomething/{something}")
    public String saySomething(@PathVariable("something") String something){
        return  ribbonService.saySomething(something);
    }
}
